package com.novax.ex.activity.infrastructure.mapper;

import com.novax.ex.activity.infrastructure.entity.TaskVersionInfo;
import com.novax.ex.common.base.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;
import com.novax.ex.activity.infrastructure.entity.UserTaskProgressDO;
import com.novax.ex.common.base.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Hsylient
 * @description 针对表【task_version_info(新手任务配置详情)】的数据库操作Mapper
 * @createDate 2023-06-20 16:47:39
 * @Entity com.novax.ex.activity.infrastructure.entity.TaskVersionInfo
 */
public interface TaskVersionInfoMapper extends BaseMapper {

    /**
     * @Description: 版本配置默认新手任务配置
     * @Author: ChenXi
     * @Date:  2023/6/21 14:19
     * @param versionId
     * @param list
     * @return: int
     **/
    int defaultTaskInsert(@Param("versionId") Long versionId, @Param("list") List<TaskVersionInfo> list);

    /**
     * 查询到某个用户他参见新手引导的具体任务
     *
     * @param uid 用户ID
     * @return 任务列表
     */
    List<TaskVersionInfo> selectUserTask(@Param("uid") Long uid);

    /**
     * 通过language来查询用户任务的多语言名称
     * 通过versionID来定位用户所在的任务是哪一个
     *
     * @param language 语言
     * @param versionId 版本信息
     * @return 返回UserTaskProgressDO
     */
    List<UserTaskProgressDO> selectUserTaskList(@Param("language") String language, @Param("versionId") Long versionId);


    TaskVersionInfo selectByStepAndVersionId(@Param("step") Integer step, @Param("versionId") Long versionId);

    /**
     * @Description: 修改任务绑定
     * @Author: ChenXi
     * @Date:  2023/6/30 10:14
     * @param id
     * @param taskId
     * @param rechargeCount
     * @param transactionCount
     * @return: int
     **/
    int updateTaskIdAndCount(@Param("id") Long id,
                             @Param("taskId") Long taskId,
                             @Param("rechargeCount") Integer rechargeCount,
                             @Param("transactionCount")Integer transactionCount);

    /**
     * @Description: 删除关联的所有任务配置
     * @Author: ChenXi
     * @Date:  2023/6/30 10:55
     * @param id
     * @return: int
     **/
    int deleteByVersionId(Long id);

}
